package ls.repository;

import ls.model.Moaning;
import ls.model.Reply;
import ls.model.Vote;

import java.util.List;

/**
 * 
 * Repository interface for NoSQL implementation.
 * 
 */
public interface MoaningRepository2 {

    long getMoaningCount();

    /**
     * Only adds the moaning (no referenced objects).
     * 
     * @param moaning
     * @return 
     */
    long saveMoaning(Moaning moaning);

    /**
     * Loads the moaning with all the referenced objects.
     * 
     * @param id
     * @return 
     */
    Moaning getMoaning(long id);

    /**
     * Loads the moaning with all the referenced objects.
     * 
     * @param id
     * @return 
     */
    Moaning getRandomMoaning();

    /**
     * 
     * Loads the moaning with all the referenced objects.
     * 
     * @param minReplies
     * @return 
     */
    Moaning getRandomMoaning(int minReplies);

    /**
     * Loads the moaning with all the referenced objects.
     * 
     * @param id
     * @return 
     */
    List<Moaning> getMoanings();

    
    void addReply(Reply reply, long moaningId);
    
    void addVote(Vote vote, long moaningId);
}
